Skip to main content

3.3 Physics simulation and sensor simulation

Physics Simulation and Sensor Simulation


🧩 1. Introduction

Is section mein hum Gazebo physics engine aur sensor simulation ko detail mein explore karenge.
Gazebo robots ke real‑world behavior ko simulate karta hai --- jisme gravity, friction, collision, inertia aur sensors ke realistic outputs shamil hote hain.


⚙️ 2. Physics Simulation in Gazebo

Gazebo physics simulation real-world ke physical rules ko imitate karti hai. Isme:

  • Gravity
  • Friction
  • Collisions
  • Inertia
  • Joint dynamics
  • Contact forces

simulate ki jati hain taake robot realistically behave kare.


🔸 Physics Engine Types

Gazebo multiple physics engines support karta hai:

  • ODE (default)
  • Bullet
  • DART
  • Simbody

🔸 Example: Physics Block in SDF

<physics name="default_physics" type="ode">
<gravity>0 0 -9.8</gravity>
<max_step_size>0.001</max_step_size>
<real_time_factor>1</real_time_factor>
</physics>

📡 3. Sensor Simulation in Gazebo

Gazebo virtually simulate karta hai:

  • Cameras\
  • LIDAR\
  • IMU\
  • GPS\
  • Sonar\
  • Depth cameras\
  • Force/Torque sensors

Sensors ka output exact real hardware jaisa hota hai.


🔸 Sensor Example in SDF (LIDAR)

<sensor name="lidar_sensor" type="ray">
<update_rate>20</update_rate>
<ray>
<scan>
<horizontal>
<samples>360</samples>
<resolution>1</resolution>
<min_angle>-3.14</min_angle>
<max_angle>3.14</max_angle>
</horizontal>
</scan>
</ray>
</sensor>

🔄 4. Workflow Diagram (Physics + Sensors → Gazebo Simulation)

[Define Physics in SDF] ↓ [Add Sensors to Model] ↓ [Load in Gazebo] ↓ [Simulated Physics Engine] ↓ [Realistic Sensor Output] ↓ [Robot Testing & Debug]


🧪 5. Practical Steps (One-by-One Workflow)

✅ Step 1: Robot model ke SDF/URDF file mein physics parameters add karein

Gravity, friction, inertia, collision tags set karein.

✅ Step 2: Sensor definitions add karein

Camera, LIDAR, IMU sensors shamil karein.

✅ Step 3: Gazebo run karein

gazebo my_robot.sdf

✅ Step 4: Sensor outputs observe karein

Gazebo topic viewer se LIDAR, camera feed check karein.

✅ Step 5: Physics tuning & debugging

Realistic behavior ke liye friction, damping aur mass adjust karein.


📘 Self Assignment Time

MCQs (Attempt Yourself)

  1. Gazebo physics engine kis cheez ko simulate karta hai?
    A. Only visuals
    B. Real-world physical behavior
    C. Only sound
    D. Networking

  2. Gazebo ka default physics engine kaunsa hota hai?
    A. DART
    B. Bullet
    C. ODE
    D. Simbody

  3. LIDAR kis type ka sensor hota hai?
    A. Camera sensor
    B. Ray-based range sensor
    C. Temperature sensor
    D. Sound-based sensor

  4. Sensor simulation ka main purpose kya hota hai?
    A. Robot ki decoration
    B. Realistic sensor output generate karna
    C. Only logging
    D. None

  5. Physics tuning mein sabse important parameter kya hota hai?
    A. Font size
    B. Friction, mass aur inertia
    C. Background color
    D. Network speed


✔️ Correct Answers

  1. B\
  2. C\
  3. B\
  4. B\
  5. B